using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class rp_BillsMap : EntityTypeConfiguration<rp_Bills>
    {
        public rp_BillsMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.BillNumber)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Physician)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.PatientID)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("rp_Bills");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.BillNumber).HasColumnName("BillNumber");
            this.Property(t => t.BillDate).HasColumnName("BillDate");
            this.Property(t => t.Physician).HasColumnName("Physician");
            this.Property(t => t.BillAmount).HasColumnName("BillAmount");
            this.Property(t => t.Balance).HasColumnName("Balance");
            this.Property(t => t.PatientID).HasColumnName("PatientID");
        }
    }
}
